from pms.common.views import PostFormula
from project.models import ProjectDocument
from project.utils.document import document_view


class API(PostFormula):

    def handle(self, req):
        doc_id = req['id']
        return self.success_respond(document_view(
            document=ProjectDocument.objects.get(id=doc_id)
        ))
